import { Layout } from '@ycx/ui';
import { FC, PropsWithChildren } from 'react';
import Sider from '@/layouts/components/Sider.tsx';
import { useSetSiderCollapsed, useSiderCollapsed, useTheme } from '@/store/settingsStore.ts';

const LayoutWrapper: FC<PropsWithChildren> = ({ children }) => {
  const theme = useTheme();
  const collapsed = useSiderCollapsed();
  const siderCollapsed = useSetSiderCollapsed();
  return (
    <>
      <Layout
        collapsed={collapsed}
        theme={theme}
        siderRender={<Sider />}
        onCollapse={siderCollapsed}
      >
        {children}
      </Layout>
    </>
  );
};

export default LayoutWrapper;
